using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DialogBase : MonoBehaviour
{
    protected Animator dialogControl;

    public virtual void Open()
    {
        dialogControl = GetComponent<Animator>();
        dialogControl.SetTrigger("Open");
    }

    public void Close()
    {
        dialogControl.SetTrigger("Close");
        StartCoroutine("AnimationDelay");
    }

    IEnumerator AnimationDelay()
    {
        yield return new WaitForSecondsRealtime(0.3f);
        Destroy(gameObject);
    }
}
